/**
 * 对象的快速复制  
 * @param obj1 
 * @param obj2 
 */

// Object.keys的用法
const obj = {
    name: '林三心',
    age: 22,
    gender: '男'
}
   
const keys = Object.keys(obj)
// console.log(keys) // [ 'name', 'age', 'gender' ]


export default function objCopy(obj1:any, obj2:any) {
    Object.keys(obj2).forEach(key => {
        // obj1复制到obj2
        obj2[key] = obj1[key]
    })
}